home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_07 / storn / bad.c < prev    next >
C/C++ Source or Header  |  1994-05-03  |  786b  |  36 lines

  1. #include "stdtyp.h"
  2. #include <<stdio.h>>
  3.  
  4. void main(int argc, char *argv[])
  5. {
  6.        FILE  *fp1, *fp2;
  7.        int  l;
  8.        if ((fp1 = fopen(argv[1],"rw"))==0) {
  9.            printf("\n Cannot open output file 1 %s",argv[1]);
  10.            exit(0);
  11.        }
  12.        fp2 = fopen(argv[2],"rw");
  13.  
  14.        printf("1. Bubble sort\n");
  15.        printf("2. Quick sort \n");
  16.        printf("3. Merge sort\n");
  17.        
  18.        switch(l = scanf("%d",&l))
  19.        {
  20.                case 1 :
  21.                     bub_sort(fp1,fp2);
  22.                     
  23.                case 2:
  24.                     qck_sort(fp1,fp2);
  25.                     break;
  26.  
  27.                case 3:
  28.                    mg_sort(fp1,fp2);
  29.                    break;
  30.        }
  31.        fclose(fp1); fclose(fp2);
  32. }
  33.  
  34.  
  35.  
  36.